var url=null;
chrome.webRequest.onBeforeSendHeaders.addListener(details => {
        if((details.url).search(/\.aac/g)>-1||(details.url).search(/\.mp3/g)>-1||(details.url).search(/\.m4a/g)>-1 && (details.url).search(/\.gif/g)==-1){//过滤gif 和 媒体
            if((details.url).search("node.kg.qq.com")==-1){//全民k歌兼容
                if(details.initiator=="https://music.163.com"){//网易规则
                    if((details.url).search('music.126.net')!=-1 && details.url.substr(details.url.length-3,details.url.length)=='mp3' || details.url.substr(details.url.length-3,details.url.length)=='m4a'){//找到网易host
                        url = details.url; 
                    }
                }else{//全民k歌
                    url = details.url;
                }
            }
        }
	}, 
	{
		urls: ["<all_urls>"]
	}
);
